<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // 1.  str.split(分隔符)
        // 作用：把字符串分隔，得到一个字符串数组
        const str = 'The quick brown fox jumps over the lazy dog.';

        const words = str.split(' ') // 空格
        console.log(words)

        const str1 = '2022-12-23'
        // split 字符串转数组  join ：数组转字符串
        const arr = str1.split('-')
        console.log(arr)
    </script>
</body>
</html>